package com.starling.control.file
{
	import com.starling.utils.TextureUtil;
	
	import flash.filesystem.File;
	import flash.net.FileFilter;
	import flash.utils.ByteArray;
	
	public class FileBase extends File
	{
		public static const SWF:String = "swf";
		public static const PSD:String = "psd";
		public static const DIR:String = "dir";
		
		public var fileItems:Array;
		
		protected var _fileNum:int;
		protected var _fileSize:Number;
		protected var _callback:Function;
		
		public function FileBase(path:String=null)
		{
			super(path);
		}
		
		
		/** 加载文件 */
		public function loadFile(callback:Function):void
		{
			_callback = callback;
		}
		
		
		
		/** 文件信息 */
		public function getInfo(scale:Number):Object
		{
			return null;
		}
		
		
		
		/** 回收 */
		public function dispose():void
		{
			
		}
		
		
		
		
		
		/** 文件名 */
		public function get fileName():String
		{
			return decodeURI(this.isDirectory?name:name.substring(0 ,name.lastIndexOf(".")));
		}
		
		/** 保存路径 */
		public function get savePath():String
		{
			return decodeURI((this.isDirectory?this.nativePath:this.parent.nativePath))+"/"+fileName+"Texture/";
		}
		
		/** 文件类型 */
		public function get fileType():String
		{
			return this.isDirectory?FileBase.DIR:this.extension;
		}
		
		/** 文件最后修改时间 */
		public function get fileUpdate():String
		{
			return BDate.formatDate(this.modificationDate);
		}
		
		/** 文件大小 */
		public function get fileSize():Number
		{
			return _fileSize;
		}
		
		/** 文件数量 */
		public function get fileNum():int
		{
			return _fileNum;
		}
	}
}